New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove config key normalization #4742
Conversation
Previously we'd normalize all key names in dask.config to hyphenated names, replacing all underscores with hyphens. This causes problems with keys that should be taken as literal values (e.g. environment variables in an env key). We now keep the user-facing functions (e.g. ``get``, ``set``, etc...) agnostic to hyphen/underscores, but leave new keys unchanged. This has the nice property that once a key is in the config it can be looked up or changed by any provided name, but new keys (which may potentially be data instead of config names) are unchanged.
cc @djhoese |
Original changes by @jcrist, adapted for donfig. See dask/dask#4742 for details.
Planning on merging tomorrow if no comment. |
dask/config.py
Outdated
def canonical_name(k, config): | ||
"""Return the canonical name for a key. | ||
|
||
Handles user choose of '-' or '_' conventions by standardizing on whichever |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small typo choose
-> choice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed.
Merging. |
These changes have been ported to the |
* Remove config key normalization Previously we'd normalize all key names in dask.config to hyphenated names, replacing all underscores with hyphens. This causes problems with keys that should be taken as literal values (e.g. environment variables in an env key). We now keep the user-facing functions (e.g. ``get``, ``set``, etc...) agnostic to hyphen/underscores, but leave new keys unchanged. This has the nice property that once a key is in the config it can be looked up or changed by any provided name, but new keys (which may potentially be data instead of config names) are unchanged. * Type [skip ci]
Previously we'd normalize all key names in dask.config to hyphenated
names, replacing all underscores with hyphens. This causes problems with
keys that should be taken as literal values (e.g. environment variables
in an env key).
We now keep the user-facing functions (e.g.
get
,set
, etc...)agnostic to hyphen/underscores, but leave new keys unchanged. This has
the nice property that once a key is in the config it can be looked up
or changed by any provided name, but new keys (which may potentially be
data instead of config names) are unchanged.
Supersedes #4422.
Fixes #4366.